const userService = require("../service/user-service");
class UserController {
  async create(ctx, next) {
    //2.1获取用户传过来的数据
    const user = ctx.request.body;
    //2.2 将user信息传递到数据库中
    const result = await userService.create(user);
    //2.3 查看存储结果，告知前端创建成功
    ctx.body = {
      message: `创建用户成功`,
      data: result,
    };
  }
}
module.exports = new UserController();
